#!/bin/bash
# ***************************************************************
# *                    simula+@metz.ensam.fr                    *
# *	              GNU/linux version 0.2.4                   *
# *            software under General Public License            *
# ***************************************************************
# * copyright  2003,2004,2005,2006,2007 COLLARD Christophe
# * copyright  2003,2004,2005,2006,2007 Laboratoire de Physique et Mcanique des Matriaux (LPMM - UMR 7554)
# * copyright  2003,2004,2005,2006,2007 Laboratoire de Mathmatiques et ses Applications de Valenciennes (LAMAV - EA 4015)
# ***************************************************************/

#    run MateriOL++ belongs to Materials Object Libraries (MateriOL++) </br>
#    MateriOL++ is part of Simula+ <br><br>
#
#    Simula+ is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version. <br><br>
#
#    Simula+ is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details. <br><br>
#
#    You should have received a copy of the GNU General Public License
#    along with Simula+; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


# color definition
GREEN="\\033[1;32m"
NORMAL="\\033[0;39m"
RED="\\033[1;31m"
PINK="\\033[1;35m"
BLUE="\\033[1;34m"
WHITE="\\033[0;02m"
LIGHTWHITE="\\033[1;08m"
YELLOW="\\033[1;33m"
CYAN="\\033[1;36m"


# checks Simula+ has been started correctly
if [ "$rat" != "true" ]; then
    echo -e $RED"Please, configure & execute 'run simula+ tests' to start tests"$NORMAL
    exit
fi


cd MateriOL++
if [ -f MateriOL++.exe ]; then 
    rm MateriOL++.exe
fi
$compiler -w -I $SimulaPlus -o MateriOL++.exe tests-MateriOL++.cpp
if [ -f MateriOL++.exe ]; then 
     ./MateriOL++.exe
     rm MateriOL++.exe
     rm *.res
else if [ -f ../simula+.old ]; then
        mv -f ../simula+.old ../simula+.bak
     fi
fi
cd ..
